package com.songlanyun.modules.article.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.songlanyun.common.drive.RootEntity;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 文章课程分类表
 *
 * @author wuchao
 * @email sunlightcs@gmail.com
 * @date 2021-03-01 14:12:17
 */
@Data
@TableName("yxt_article_course_classify")
public class ArticleCourseClassify extends RootEntity<Long, ArticleCourseClassify> implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @TableId
    private Long id;
    /**
     * 课程名称
     */
    @NotBlank(message = "课程名称不能为空")
    @Length(min = 1, max = 30, message = "课程名称长度在1-30个字")
    private String courseName;
    /**
     * 排序
     */
    @NotNull(message = "排序不能为空")
    private Integer orderIndex;

    @TableField(exist = false)
    private Integer articleNum;

    /**
     *
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    /**
     *
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @Override
    public Long getIdentity() {
        return this.getId();
    }
}
